/*
 * @Descripttion: 出手鸭小程序
 * @version:1.0.1 
 * @Author: HHL
 * @Date: 2023-10-15 09:54:19
 * @LastEditTime: 2023-10-15 09:54:27
 * @LastEditors:Hui
 */


import { waitShowToast } from "./index"

const copy = (text) => {
  if (!text) { return }

  // #ifdef MP-ALIPAY
  my.setClipboard({
    text,
    success: () => {
      waitShowToast('复制成功', 0)
    },
    fail: () => {
      waitShowToast('复制失败', 0)
    }
  })
  // #endif

  // #ifndef MP-ALIPAY
  uni.setClipboardData({
    data: text,
    success: () => {
      waitShowToast('复制成功', 0)
    },
    fail: () => {
      waitShowToast('复制失败', 0)
    }
  })
  // #endif
}

export default copy